package com.rupertjones.globalcron.domain;

import org.springframework.stereotype.Repository;

import static org.hibernate.criterion.Restrictions.eq;

/**
 * <p>&copy Rupert Jones 2011</p>
 *
 * @author rup
 */
@Repository
public class HostDAO extends AbstractHibernateDAO<Host> {
    public HostDAO() {
        super(Host.class);
    }

    public Host findByHostName(String name) {
        return (Host) getCriteria().add(eq("hostname", name)).uniqueResult();
    }
}
